/**
 * 
 */
package cn.panda.edu.service.impl;

import cn.panda.edu.dao.SectionMapper;
import cn.panda.edu.model.Section;
import cn.panda.edu.service.SectionService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**  
 * 类描述：  
 */
@Service
public class SectionServiceImpl implements SectionService {

	@Resource
	private SectionMapper sectionMapper;
	/* (non-Javadoc)
	 * @see cn.panda.edu.serviceapi.SectionService#getAllSection(java.lang.String)
	 */
	@Override
	public List<Section> getAllSection(String sectionName,Integer courseId) {
		// TODO Auto-generated method stub
		return sectionMapper.getAllSection(sectionName,courseId);
	}
	/* (non-Javadoc)
	 * @see cn.panda.edu.serviceapi.SectionService#insertSelective(cn.panda.edu.model.Section)
	 */
	@Override
	public int insertSelective(Section record) {
		// TODO Auto-generated method stub
		return sectionMapper.insertSelective(record);
	}
	/* (non-Javadoc)
	 * @see cn.panda.edu.serviceapi.SectionService#updateByPrimaryKeySelective(cn.panda.edu.model.Section)
	 */
	@Override
	public int updateByPrimaryKeySelective(Section record) {
		return sectionMapper.updateByPrimaryKeySelective(record);
	}
	@Override
	public List<Section> selectByCourseId(Integer courseId, Integer pageIndex) {
//		Page<Section> list = PageHelper.startPage(pageIndex, 5) ;
		List<Section> list= sectionMapper.selectByCourseId(courseId) ;
		return  list ;
	}

}
